﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for LoaiSanPhamEntity
/// </summary>
public class LoaiSanPhamEntity
{

    private int maLoai;
    private string tenLoai;
    public LoaiSanPhamEntity()
    { }
    public LoaiSanPhamEntity(int maLoai, string tenLoai)
    {
        this.maLoai = maLoai;
        this.tenLoai = tenLoai;
    }
    public int MaLoai
    {
        get { return this.maLoai; }
        set
        {
            if (value == null)
                throw new Exception("maLoai not allow nullvalue.");
            this.maLoai = value;
        }
    }
    public string TenLoai
    {
        get { return this.tenLoai; }
        set { this.tenLoai = value; }
    }
    public override string ToString()
    {
        return this.maLoai + "; " + this.tenLoai + "; ";
    }
    public override bool Equals(Object obj)
    {
        LoaiSanPhamEntity me = (LoaiSanPhamEntity)obj;
        bool ret = this.MaLoai.Equals(me.MaLoai);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.MaLoai.GetHashCode();
    }

}